<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<div id="app">
    <ul>
        <li v-for="(item,index) in arr" :key="index">{{item}}--{{index}}</li>
    </ul>

    <ol>
        <li v-for="(value,key,index) in obj">value:{{value}}--key:{{key}}--index:{{index}}</li>
    </ol>
</div>
</body>

</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    // v-for 可以用于去渲染列表

    //  参数可以不用传完整,但是至少要传入一个

    // 数组语法:v-for="(item,index) in arr"

    // 对象语法:v-for="(value,key,index) in obj"
    let vm = new Vue({
        data: {
            arr: ['吃', '睡', '看小说', '玩游戏'],
            obj: {
                name: '李雷',
                age: 20
            }
        }
    }).$mount('#app')
</script>